"use strict"

this.Util =

  isOverlapping: (a, b, options = {}) ->
    x = a.x < b.x1 && a.x1 > b.x
    y = a.y < b.y1 && a.y1 > b.y
    if      options.x_only then x
    else if options.y_only then y
    else x && y

  trimValue: (v, min, max) ->
    Math.max(min, Math.min(max, v))

# # monkey patching
# Array::remove = (e) -> @[t..t] = [] if (t = @indexOf(e)) > -1
